package com.designpatterns.creational.prototype.deepclone;


import java.io.IOException;

public class Client {
    public static void main(String[] args) throws IOException, ClassNotFoundException {
        WeeklyLog weeklyLog = new WeeklyLog(); //创建原型对象
        Attachment attachment = new Attachment(); //创建附件对象
        weeklyLog.setAttachment(attachment); //将附件添加到周报中
        WeeklyLog weeklyLog_new = weeklyLog.deepClone();
        //比较周报
        System.out.println("周报是否相同？" + (weeklyLog == weeklyLog_new));
        //比较附件
        System.out.println("附件是否相同？" + (weeklyLog.getAttachment() == weeklyLog_new.getAttachment()));
    }
}
